package com.tengju.user.domain.model.sign;

import lombok.Getter;

@Getter
public enum StarAuditStatEnum {
    WAIT_AUDIT(0,"待审核"),
    PASS_AUDIT(10,"审核通过"),
    DENY_AUDIT(20,"审核拒绝");

    private int code;
    private String desc;

    StarAuditStatEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static boolean isPass(Integer auditStat) {
        if (auditStat != null && auditStat == PASS_AUDIT.getCode()) {
            return true;
        }
        return false;
    }

    public static StarAuditStatEnum fromVal(Integer val) {
        if (val == null) {
            return null;
        }
        for (StarAuditStatEnum type : values()) {
            if (type.code == val) {
                return type;
            }
        }
        return null;
    }
}
